extends Node2D

var No=0
#名字 
var Name="" setget Name_set 
#费用
var cost=1 setget cost_set 
#使用者名字
var userName="" setget userName_set
#卡牌描述
var description="" setget description_set
#插图
var image="" setget image_set

var card

func Name_set(value):
	Name=value
	$"名字".text=Name
func cost_set(value):
	cost=value
	$"费用".text=String(cost)
func userName_set(value):
	userName=value
	$"使用者".text=userName
func description_set(value):
	description=value
	$"描述".text=description
func image_set(value):
	image=value
	$"插图".texture=load("res://Sprites/Cards/"+image+".png")

func _ready():
	# Called when the node is added to the scene for the first time.
	# Initialization here
	pass

func loadData(cardData):
	self.No=cardData.No
	self.Name=cardData.Name
	self.cost=cardData.cost
	#self.userName=cardData.userName
	self.description=cardData.description
	self.image=cardData.image

func loadCard(card_):
	self.No=card_.No
	self.Name=card_.Name
	self.cost=card_.cost
	#self.userName=cardData.userName
	self.description=card_.description
	self.image=card_.image
	self.userName=card_.userName
	card=card_
